# CMakeLists.txt for objPool test

# 设置CMake最小版本要求
cmake_minimum_required(VERSION 3.10)

# 设置项目名称
project(objPool_test)

# 设置C++标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 设置编译选项
if(MSVC)
    add_compile_options(/W4 /WX)
else()
    add_compile_options(-g  -Wall -Wextra -Werror)
endif()
add_link_options(-g)
add_definitions( -D__LINUX__ -D__DEBUG__ -DSHOW_FILE_INFO=1)
# 设置包含目录
include_directories(../../include)

set(WHEELS_PATH ../../)
# 添加源文件
add_executable(objPool_test objPool_test.cpp 
    ${WHEELS_PATH}/src/misc.cpp
    ${WHEELS_PATH}/src/fs.cpp
    )

# 链接必要的库
find_package(Threads REQUIRED)
target_link_libraries(objPool_test PRIVATE Threads::Threads)

# 设置输出目录
set(OUTPUT_DIR ${CMAKE_BINARY_DIR}/bin)
set_target_properties(objPool_test PROPERTIES
    RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR}
    RUNTIME_OUTPUT_DIRECTORY_DEBUG ${OUTPUT_DIR}
    RUNTIME_OUTPUT_DIRECTORY_RELEASE ${OUTPUT_DIR}
)

# 添加测试
enable_testing()
add_test(NAME objPool_test COMMAND objPool_test)